package com.hezuti.info.dao;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Property;
import org.springframework.stereotype.Component;

import com.hezuti.common.dao.BaseHibernateDaoGeneric;
import com.hezuti.info.domain.City;

@Component
public class CityDao  extends BaseHibernateDaoGeneric<City>{
	
	/**
	 * 按照省份找出所有的城市
	 * @param pid
	 * @return
	 */
	public List<City> findAllByPid(int pid){
		Criteria criteria = this.createCriteria(Property.forName(
				City.FIELD_PID).eq(pid));
		return this.findBy(criteria);
	}
}
